import {
    createStore
} from 'vuex'
// 导入vuex模块
import User from './modules/user'
import Cart from './modules/cart'
import Category from './modules/category'
import createPersistedstate from 'vuex-persistedstate'
export default createStore({
    modules: {
        user: User,
        cart: Cart,
        cate: Category
    },
    plugins: [
        createPersistedstate({
            key: 'kuaijian',
            paths: ['user', 'cart'], // 需要持久化存储的模块
            storage: window.localStorage // 默认的存储方式
        })
    ]
})